package com.itheima.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import com.itheima.crm.domain.Customer;

public interface ICustomerService {

	// 查询所有未关联的客户列表
	@Path("/noassociationcustomers")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomer();

	// 查询所有关联到指定定区的客户列表
	@Path("/associationfixedareacustomers/{fixedAreaId}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findAssociationFixedAreaCustomers(
			@PathParam("fixedAreaId") String fixedAreaId);

	// 关联客户到指定定区
	@Path("/associationcustomertofixedarea")
	@PUT
	public void associationCustomerToFixedArea(
			@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);

	// 客户注册
	@Path("/customer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void regist(Customer customer);

	// 根据手机号查询客户
	@Path("/customer/telephone/{telephone}")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public Customer findByTelephone(@PathParam("telephone") String telephone);

	// 将邮箱注册状态改变
	@Path("/customer/updatetype/{telephone}")
	@GET
	public void updateType(@PathParam("telephone") String telephone);

	// 登录
	@Path("/customer/login")
	@GET
	@Produces({ "application/xml", "application/json" })
	public Customer login(@QueryParam("telephone") String telephone,
			@QueryParam("password") String password);
	
	//根据地址获取定区id
	@Path("/customer/findfixedAreaIdByAddress")
	@GET
	@Produces({ "application/xml", "application/json" })
	public String findfixedAreaIdByAddress(@QueryParam("address")String address);
}
